<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
	<head>
		<title>{t}Create a link{/t}</title>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<meta name="robots" content="noindex, nofollow, noydir, noodp" />

		<script src="{$URL_RELATIVE}/js/lib/tiny_mce/tiny_mce_popup.js" type="text/javascript"></script>
        
        <link rel="stylesheet" type="text/css" href="{$URL_RELATIVE}/themes/{$BACK_THEME}/backend/css/reset.css" />
        <link rel="stylesheet" type="text/css" href="{$URL_RELATIVE}/themes/{$BACK_THEME}/backend/css/mceLinkManager.css" />

        <script src="{$URL_RELATIVE}/js/lib/jQuery/jquery.min.js" type="text/javascript"></script>
        <script src="{$URL_RELATIVE}/themes/{$BACK_THEME}/backend/js/jQueryMceLinkManager.js" type="text/javascript"></script>
  </head>
  <body>
      <form name="form" action="" method="post">
          <table>
              <tr>
                  <th colspan="2">{icon name="dark_arrow_down.png"} {t}Link{/t}</th>
              </tr>
              <tr>
                  <td><label for="page">{t}To a page{/t}</label></td>
                  <td>
                      <select name="page" id="page">
                          <option value="null">---</option>
                          {foreach from=$pages item=ws}
                              <optgroup label="{$ws.website->getLabel()} - {$ws.website->getLang()}">
                              {foreach from=$ws.childs item=child}
                                   {if $child.menu->getUniqueId() != $ws.website->getUniqueId()}<optgroup label="&nbsp;&nbsp;&nbsp;{$child.menu->getLabel()}">{/if}
                                   {foreach from=$child.pages item=page}
                                  {assign var=parent value=$page->getDocumentParent()}
                                  <option value="{$page->getUniqueId()}_{$page->getLang()}">{$page->getLabel()} - {$page->getUniqueId()}</option>
                                  {/foreach}
                                  {if $child.menu->getUniqueId() != $ws.website->getUniqueId()}</optgroup>{/if}
                              {/foreach}
                              </optgroup>
                          {/foreach}
                      </select>
                      <a href="#" target="_blank" id="pageLink" class="itemButton itemViewButton" style="display:none"></a>
                  </td>
              </tr>
              {if count($targets) > 0}
              <tr>
                  <td>{t}To a targeted page{/t}</td>
                  <td>
                      <select name="target" id="target">
                          <option value="null">---</option>
                          {foreach from=$targets item=child}
                          <optgroup label="{$child.website->getLabel()} - {$child.website->getLang()}">
                          {foreach from=$child.targets item=target}
                          <option value="{$target.name}_{$child.website->getLang()}_{$child.website->getUniqueId()}" title="{$target.document->getUniqueId()}">{$target.label} - {$target.document->getUniqueId()}</option>
                          {/foreach}
                          </optgroup>
                          {/foreach}
                      </select>
                      <a href="#" target="_blank" id="targetLink" class="itemButton itemViewButton" style="display:none"></a>
                  </td>
              </tr>
              {/if}
              {if count($medias) > 0}
              <tr>
                  <td>{t}To a document{/t}</td>
                  <td>
                      <select name="media" id="media">
                          <option value="null">---</option>
                          {foreach from=$medias item=media}
                          <option value="{$media.document_uid}">{$media.document_label}</option>
                          {/foreach}
                      </select>
                  </td>
              </tr>
              {/if}
              <tr>
                  <td><label for="href">{t}To url{/t}</label></td>
                  <td>
                      <input type="text" name="href" id="href" />
                      <a href="#" target="_blank" id="hrefLink" class="itemButton itemViewButton" style="display:none"></a>
                  </td>
              </tr>
              <tr>
                  <th colspan="2">{icon name="dark_arrow_down.png"} {t}Options{/t}</th>
              </tr>
              <tr>
                  <td><label for="openNewWindow">{t}Open in a new window{/t}</label></td>
                  <td>
                      <input type="checkbox" name="openNewWindow" id="openNewWindow" />
                  </td>
              </tr>
              <tr>
                  <td><label for="title">{t}Title{/t}</label></td>
                  <td>
                      <input type="text" name="title" id="title" />
                  </td>
              </tr>
              <tr>
                  <td><label for="title">{t}CSS class{/t}</label></td>
                  <td>
                      <input type="text" name="class" id="class" />
                  </td>
              </tr>
          </table>
          <div id="footer">
              <button type="submit" id="saveButton" class="bigGreenButton">{t}Save{/t}</button>
          </div>
      </form>
  </body>
</html>
